package com.hopedove.tempdemo.net

data class NoticeBill(
    var COLORNO: String? = null,
    var MACHINENO: String? = null,
    var B1B2: String? = null,
    var COLORGROUP: String? = null,
    var EMPNO2: String? = null,
    var REMARK1: String? = null,
    var EMPNO1: String? = null,
    var CLOTHNO: String? = null,
    var REPLACECONTNO: String? = null,
    var REMARK3: String? = null,
    var REMARK2: String? = null,
    var SPCINFO: String? = null,
    var WEIGHTDATE: String? = null,
    var METERLENGTH: String? = null,
    var CLOTHTKTNO: String? = null,
    var COLOR: String? = null,
    var CONTACTNO: String? = null,
    var CLOTHSIZE: String? = null,
    var COLORNAME: String? = null,
    var CELLNO1: String? = null,
    var CLOTHWEIGHT: String? = null,
    var CELLNO2: String? = null,
    var FINISHWEIGHT: String? = null,
) {

    fun specInfoFormat(): String {
        val info = SPCINFO ?: ""
        return if ("*" in info) {
            "圆筒"
        } else {
            REMARK3 ?: ""
        }
    }

    fun contractNoFormat(): String {
        val prefix = REPLACECONTNO?.let { "${it}代:\n" }
        val content = prefix?.let { "${it}$CONTACTNO" }
        return content ?: CONTACTNO ?: ""
    }

}
